package cn.gson.crm.model.dao;


import java.util.List;


import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import cn.gson.crm.model.pojo.ConstactOrder;
import cn.gson.crm.model.pojo.Orderdetails1;

public interface OrderDetailsDAO extends CrudRepository<Orderdetails1, Long> {
	
	@Query("FROM Orderdetails1 o order by o.odId desc")
	public List<Orderdetails1> getAllOrderDetails(Pageable pageable);
	
	@Query("from Orderdetails1 o where o.id=?1")
	public Orderdetails1 findByodId(long id);
	
	@Query("select max(c.odId) from Orderdetails1 c")
	public Long getMaxId();
	
}
